#ifndef TIMERFACTORY_H
#define TIMERFACTORY_H

#include "../global.h"
#include "../memorypool.h"
#include <boost/shared_ptr.hpp>

class Timer;
class AsyncService;

class TimerFactory : protected boost::noncopyable
{
public:
    typedef boost::shared_ptr< Timer > TimerPtr;

public:
    TimerFactory(AsyncService &service);
    ~TimerFactory();

    TimerPtr create(unsigned int owner, unsigned int id, unsigned long elapse, unsigned int repeat);

protected:
    void destroy(Timer *p);

protected:
    AsyncService &m_service;

    MemoryPool m_mp;
};

#endif // TIMERFACTORY_H
